package com.example.back.feign;

import com.example.back.config.BasicConfig;
import com.example.back.fallback.FileFallback;
import com.example.common.support.Result;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 消费文件服务
 *
 * @Author wxy
 * @Date 2021/1/12 14:08
 * @Version 1.0
 */
@FeignClient(value = "file", fallback = FileFallback.class, configuration = BasicConfig.class)
public interface FileFeign {

    /**
     * 跨服务调用  文件上传
     */
    @PostMapping(value = "/file/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<Object> updateFile(@RequestPart(value = "file") MultipartFile multipartFile);
}
